package com.example.service;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.common.ApiResult;
import com.example.entity.Major;
import com.example.entity.Resource;
import com.example.exception.BusinessException;
import com.example.utils.PageResult;
import com.example.vo.ResourceVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.List;


public interface ResourceService extends IService<Resource> {

     Page<Resource> Page(@Param("page") Integer page,
                       @Param("size") Integer size);
  /* Page<ResourceVO> Page(@Param("page") Integer page,
                       @Param("size") Integer size);*/

     Integer addResource(
                         @Param("resourceTitle") String resourceTitle,
                         @Param("resourceUrl")   MultipartFile resourceUrl,
                         @Param("picUrl")        MultipartFile picUrl,
                         @Param("majorId")       Integer majorId    );

     Integer updateResource(HttpServletRequest request,
                            @Param("id")             Integer id,
                            @Param("resourceTitle")  String resourceTitle,
                            @Param("resourceUrl")    MultipartFile resourceUrl,
                            @Param("picUrl")         MultipartFile picUrl,
                            @Param("majorId")        Integer majorId);

     /**
      * 查看所有的资源
      * @return
      */
     PageResult<List<ResourceVO>> selectResource(@Param("majorId") Integer majorId,
                                                 @Param("page") Integer page,
                                                 @Param("limit") Integer limit);
}
